// vite.config.js

import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";

const baseSrc = "/";

export default defineConfig({
  resolve: {
    alias: [
      {
        find: "~@",
        replacement: baseSrc,
      },
      {
        find: "~",
        replacement: baseSrc,
      },
      {
        find: "@",
        replacement: baseSrc,
      },
    ],
  },
  plugins: [uni()],
  server: {
    host: "0.0.0.0",
    port: 8099,
    proxy: {
      "/api/v1": {
        // target: "http://192.168.101.104:8080", // 黄浩本地
        target: "http://1.95.14.177:8000", // 线上环境
        changeOrigin: true,
        // rewrite: (path) => path.replace(/^\/api\/v1/, ""),
      },
    },
  },
});
